package cn.shanke.torrentmanagerserver.core;

import cn.shanke.torrentmanagerserver.util.JWTUtil;
import org.springframework.stereotype.Component;

@Component
public class AuthTool {

    public static final String TOKEN_KEY = "TM-TOKEN";

    public static boolean checkToken(String token, String passkey) {
        return JWTUtil.verify(token, passkey);
    }

    public static String genToken(String passkey) {
        return JWTUtil.sign(passkey);
    }
}
